<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
     <sx:head parseContent="true"/>
    <title>My JSP 'employeeUpdate.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
     <form  method="post" action="Employee_update">
      <input type="hidden" name="employee.id" value="${employee.id}"/>
        <table width="100%" border="1">
          <tr>
            <th scope="row">用户名：</th>
            <td>
            <input type="text" name="employee.userName" value="${employee.userName}"/></td>
          </tr>
          <tr>
            <th scope="row">密码：</th>
            <td>
            <input type="password" name="employee.userPwd" value="${employee.userPwd}"/>
            </td>
          </tr>
          <tr>
            <th scope="row">确认密码：</th>
            <td>
            <input type="password" name="pwd" value="${employee.userPwd}"/></td>
          </tr>
          <tr>
            <th scope="row">工号：</th>
            <td>
            <input type="text" name="employee.jobNumber" value="${employee.jobNumber}"/></td>
          </tr>
          <tr>
            <th scope="row">用户姓名：</th>
            <td>
            <input type="text" name="employee.usertrueName" value="${employee.usertrueName}"/></td>
          </tr>
          <tr>
            <th scope="row">用户性别：</th>
            <td>
            <s:if test="employee.usersex">
            	<input type="radio" name="employee.usersex" value="true" checked="checked"/>男
              <input type="radio" name="employee.usersex" value="false" />女
            </s:if>
              <s:else>
              <input type="radio" name="employee.usersex" value="true"/>男
              <input type="radio" name="employee.usersex" value="false" checked="checked"/>女
              </s:else>
            </td>
          </tr>
          <tr>
            <th scope="row">部门：</th>
            <td>
              <select name="employee.department.departmentId">
               	<s:iterator value="departments" id="department">
               	<s:if test="#department==employee.department.departmentId">
               	<option value="${department.departmentId}" selected="selected">${department.departmentName}</option>
               	</s:if>
               	<s:else>
               	 <option value="${department.departmentId}">${department.departmentName}</option>
               	</s:else>
                </s:iterator>
            </select>
            </td>
          </tr>
          <tr>
            <th scope="row">职位:</th>
            <td>
              <select name="employee.post.postId">
               	<s:iterator value="posts" id="post">
               	<s:if test="#post.postId==employee.post.postId">
               	<option value="${post.postId}" selected="selected">${post.postName}</option>
               	</s:if>
               	<s:else>
               	  <option value="${post.postId}">${post.postName}</option>
               	</s:else>
                </s:iterator>
            </select>
            </td>
          </tr>
          <tr>
            <th scope="row">用户手机:</th>
            <td>
            <input type="text" name="employee.mobilePhone" value="${employee.mobilePhone}"/></td>
          </tr>
          <tr>
            <th scope="row">用户QQ:</th>
            <td>
            <input type="text" name="employee.userQq" value="${employee.userQq}"/></td>
          </tr>
          <tr>
            <th scope="row">固定电话:</th>
            <td>
            <input type="text" name="employee.phone" value="${employee.phone}"/></td>
          </tr>
          <tr>
            <th scope="row">权限组:</th>
            <td>
            <select name="employee.rightGroups.rightGroupsId">
               	<s:iterator value="rightGroups" id="rightGroup">
               	<s:if test="#rightGroup.rightGroupsId=employee.rightGroups.rightGroupsId">
                <option value="${rightGroup.rightGroupsId}" selected="selected">${rightGroup.rightContext}</option>
                </s:if>
                <s:else>
                <option value="${rightGroup.rightGroupsId}">${rightGroup.rightContext}</option>
                </s:else>
                </s:iterator>
            </select>
			</td>
          </tr>
          <tr>
            <th scope="row">生日:</th>
            <td>
              <sx:datetimepicker
			            label=""
			            name="employee.brithday"
			            key="employee.brithday"
			            value="employee.brithday"
			             />
            </td>
          </tr>
          <tr>
          <td colspan="2" align="center">
          <input type="submit" value="修改"/>
          <input type="reset" value="重置"/>
          </td>
          </tr>
        </table>
      </form>
  </body>
</html>
